﻿$(document).ready(function()
{   
	SwitchBoxDetail(1);
    SwitchBoxDetail(2);
	Pictures();
    ProductRecommend();    
    $(".jqzoom").jqueryzoom({
				xzoom: 432, //zooming div default width(default width value is 200)
				yzoom: 295, //zooming div default width(default height value is 200)
				offset: 10, //zooming div default offset(default offset value is 10)
				position: "right", //zooming div position(default position value is "right")
 				preload:1,
				lens:0
			});
});

function SwitchBoxDetail(num)
{
   $("#tagcontent"+num+" .tab_content:not(:first)").hide();
   $("#tagtitle"+num+" li").each(function(i){
       $(this).mousedown(
	   	  function(){
		  $("#tagtitle"+num+" li.nowtag").removeClass("nowtag");
		  $(this).addClass("nowtag");
		  $("#tagcontent"+num+" .tab_content:visible").hide();
		  $("#tagcontent"+num+" .tab_content:eq(" + i + ")").fadeIn(400);
	  });
   });
}

function ProductRecommend()
{
    $("#RecommondBtn").click(function()
        {   
            window.clipboardData.setData("Text",$("#Hidden1").val());
            alert("推荐商品名称与地址已经复制，请粘贴到您的QQ/MSN/taobao/Email/BBS/博客上推荐给您的好友！");
        }
    );
}

function SubmitKeyClick(button) 
{    
if (event.keyCode == 13) 
{        
event.keyCode=9; 
event.returnValue = false; 
document.all[button].click(); 
} 
} 

function Pictures()
{
    $("#sPicture ul li").each(function(i)
    {
       $(this).mouseover(
       function()
       {
        var path=$("#sPicture ul li img:eq("+i+")").attr("src").replace("s.","m.");
        $(".jqzoom > img")[0].src=path;
        $(".jqzoom > img")[0].jqimg=path.replace("m.",".");
        $("#sPicture ul li.selected").removeClass("selected");
        $("#sPicture ul li:eq("+i+")").addClass("selected");                                
         $("#aimg").attr("href",path.replace("m.",".").replace("s.","."));
       });      
    });    
}